#{extends 'layout.html' /}
#{set title:messages.get('automaticObjectives.crear.title') /}
#{script 'jquery-ui-1.8.21.custom.min.js'/}
#{script 'jquery.ui.datepicker.js'/}
#{script 'jquery.ui.datepicker-es.js'/}
#{script 'datepicker.js'/}

<div id="crudBlank" class="${type.name}">
	
	<h2 id="crudBlankTitle">&{'crud.list.title', 'automaticObjectives.crear.title'}</h2>
	
	<div class="objectForm">
	
		#{form action:@create(), enctype:'multipart/form-data', id:'objetivoAutomaticoForm'}
			
			#{field 'object.nombreAutomaticObjective'}
			<div class="crudField crud_text">
				<label for="object_nombreAutomaticObjective">
					&{'automaticObjective.nombre'}
				</label>
				<input id="object_nombreAutomaticObjective" class="${field.errorClass}" type="text" name="${field.name}" value="${object.nombreAutomaticObjective}" size="5" />
				#{ifError field.name}
					<span class="error">#{error 'object.nombreAutomaticObjective' /}</span>
				#{/ifError}
				<span class="crudHelp">
					&{'formato.requerido'}
				</span>
			</div>
			#{/field}
			
			#{field 'object.fechaLimiteAutomaticObjective'}
			<div class="crudField crud_date">
				<label for="datepicker">
					&{'automaticObjective.fechaLimite'}
				</label>
				<input id="datepicker" class="${field.errorClass}" type="text" name="${field.name}" value="${object.fechaLimiteAutomaticObjective?.format('dd/MM/yyyy')}" size="10" />
				#{ifError field.name}
					<span class="error">#{error 'object.fechaLimiteAutomaticObjective' /}</span>
				#{/ifError}
				<span class="crudHelp">
					&{'formato.fecha'}
				</span>
			</div>
			#{/field}
			
			<p class="crudButtons">
				<input type="button" class="btn" name="_cancel" onClick="window.location='@{AutomaticObjectives.list}'" value="&{'automaticObjective.cancelar'}" />
				<input type="submit" class="btn" name="_save" value="&{'crud.save', 'objetivo automático'}" />
			</p>
			
		#{/form}
	</div>
</div>
